cmake_minimum_required(VERSION 3.5)
project(common)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++17)

find_package(Boost REQUIRED COMPONENTS system)
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(agv_msgs REQUIRED)

include_directories(
  include
)

## Declare a C++ library
add_library(${PROJECT_NAME} SHARED 
  #src/common.cpp
  src/event_publisher.cpp
)

ament_target_dependencies(${PROJECT_NAME}
  "agv_msgs"
  "rclcpp"
)

ament_export_libraries(${PROJECT_NAME})
ament_export_include_directories(include)
ament_export_dependencies(rclcpp rclpy agv_msgs)
ament_package()

install(TARGETS ${PROJECT_NAME}
  ARCHIVE DESTINATION lib
  LIBRARY DESTINATION lib
  RUNTIME DESTINATION bin
)

install(DIRECTORY include/
  DESTINATION include/
  FILES_MATCHING 
    PATTERN "*.hpp"
    PATTERN "*.h"
)


